package com.crack.simpleapiclientsdk.client;

import cn.hutool.http.HttpRequest;
import com.crack.simpleapiclientsdk.annotation.RequestMethod;

import com.crack.simpleapiclientsdk.model.User;

/**
 * @version 1.0
 * @Description
 * @CreateTime 2023/3/8 18:38
 */
//@Component
public class ApiClient {

    public static final String GATEWAY_HOST = "http://localhost:8090";
    public static final String TEST_HOST = "http://localhost:8102";
    private String accessKey;

    private String secretKey;
    private Object RequestMethodEnum;

    public ApiClient() {
    }

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }



    public ApiClient(String accessKey, String secretKey) {
        this.accessKey = accessKey;
        this.secretKey = secretKey;
    }

    @RequestMethod(method = com.crack.simpleapiclientsdk.enums.RequestMethodEnum.GET)
    public String getNameByGet(String name,HttpRequest request){
        String result= request.setUrl(GATEWAY_HOST + "/api/name/get" + name).execute().body();
        return result;
    }

    @RequestMethod(method = com.crack.simpleapiclientsdk.enums.RequestMethodEnum.GET)
    public String getPcGirlGet(String aa1,HttpRequest request){
        String result= request.setUrl(GATEWAY_HOST + "/api/name/dyGirl" + aa1).execute().body();
        return result;
    }

    @RequestMethod(method = com.crack.simpleapiclientsdk.enums.RequestMethodEnum.POST)
    public String getUserNameByPost(User user,HttpRequest request){
        String result = request.setUrl(GATEWAY_HOST + "/api/name/user").execute().body();
        return result;
    }

    @RequestMethod(method = com.crack.simpleapiclientsdk.enums.RequestMethodEnum.GET)
    public String getRandomWords(String encode, HttpRequest request){
        String result = request.setUrl(GATEWAY_HOST + "/api/name/getRandomWords" +encode).execute().body();
        return result;
    }

    /*@RequestMethod(method = com.crack.simpleapiclientsdk.enums.RequestMethodEnum.GET)
    public String getPcGirlGet(String encode, HttpRequest request){
        String result = request.setUrl(GATEWAY_HOST + "/api/name/dyGirl" + encode).execute().body();
        return result;
    }*/




}
